package com.rockxin.cat.fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.orhanobut.logger.Logger;
import com.rockxin.cat.R;
import com.rockxin.cat.base.BaseFragment;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import cn.jzvd.JZVideoPlayerStandard;

/**
 * A simple {@link Fragment} subclass.
 */
public class BidVideoFragment extends BaseFragment {


    @BindView(R.id.videoplayer)
    JZVideoPlayerStandard videoplayer;
    private Unbinder bind;
    private boolean createData;

    public BidVideoFragment() {
        // Required empty public constructor
    }

    public static BidVideoFragment newInstance() {

        Bundle args = new Bundle();

        BidVideoFragment fragment = new BidVideoFragment();
        fragment.setArguments(args);
        return fragment;
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View mView = inflater.inflate(R.layout.fragment_bid_video, container, false);
        bind = ButterKnife.bind(this, mView);
        initView();
        return mView;
    }

    private void initView() {
//        videoplayer.setUp("http://jzvd.nathen.cn/c6e3dc12a1154626b3476d9bf3bd7266/6b56c5f0dc31428083757a45764763b0-5287d2089db37e62345123a1be272f8b.mp4"
//                , JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, "");
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        bind.unbind();
    }

    @org.simple.eventbus.Subscriber(tag = "bid_video")
    public void getBidVideoEvent(String url) {
        Logger.d("getBidLogEvent=====" + url);
        videoplayer.setUp("http://jzvd.nathen.cn/c6e3dc12a1154626b3476d9bf3bd7266/6b56c5f0dc31428083757a45764763b0-5287d2089db37e62345123a1be272f8b.mp4"
                , JZVideoPlayerStandard.SCREEN_WINDOW_NORMAL, "");
    }

}
